home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-12-03 | 3.6 KB | 166 lines |
- /*
- A basic extension of the java.awt.Frame class
- */
-
- import java.awt.*;
- import symantec.itools.multimedia.SoundPlayer;
-
- public class Emblaze extends Frame {
- void button1_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Start the animation
- {
- emblaze201.start();
- }
- //}}
-
- //{{CONNECTION
- // Start the sound player
- {
- soundPlayer1.play();
- }
- //}}
- }
-
- void previousimage_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Start the animation
- {
- emblaze201.start();
- }
- //}}
-
- //{{CONNECTION
- // Resume the animation
- {
- emblaze201.unfreeze();
- }
- //}}
-
- //{{CONNECTION
- // Enable the Emblaze20
- emblaze201.enable();
- //}}
- }
-
- void nextimage_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Pause the animation
- {
- emblaze201.freeze();
- }
- //}}
- }
-
- void close_Clicked(Event event) {
-
-
- //{{CONNECTION
- // Pause the animation
- {
- emblaze201.freeze();
- }
- //}}
-
- //{{CONNECTION
- // Hide the Frame
- hide();
- //}}
- }
-
-
- public Emblaze() {
-
- //{{INIT_CONTROLS
- setLayout(null);
- addNotify();
- resize(insets().left + insets().right + 477,insets().top + insets().bottom + 388);
- emblaze201 = new geo.emblaze.Emblaze20();
- emblaze201.reshape(insets().left + 79,insets().top + 23,346,276);
- add(emblaze201);
- try {
- emblaze201.setFileURL(symantec.itools.net.RelativeURL.getURL("blaze/symantec.blz"));
- } catch (java.net.MalformedURLException error) {
- }
- nextimage = new java.awt.Button("Pause the Video");
- nextimage.reshape(insets().left + 171,insets().top + 354,138,24);
- add(nextimage);
- previousimage = new java.awt.Button("Resume playing Video");
- previousimage.reshape(insets().left + 313,insets().top + 354,138,24);
- add(previousimage);
- close = new java.awt.Button("Close");
- close.reshape(insets().left + 28,insets().top + 354,138,24);
- add(close);
- button1 = new java.awt.Button("Start the Video");
- button1.reshape(insets().left + 170,insets().top + 321,138,24);
- add(button1);
- soundPlayer1 = new symantec.itools.multimedia.SoundPlayer();
- soundPlayer1.setSyncMode(true);
- soundPlayer1.setRepeat(2);
- try {
- java.net.URL[] tempURL = new java.net.URL[1];
- tempURL[0] = symantec.itools.net.RelativeURL.getURL("sounds/T2.au");
- soundPlayer1.setURLList(tempURL);
- } catch (java.net.MalformedURLException error) {
- }
- //$$ soundPlayer1.move(7,346);
- setTitle("Untitled");
- //}}
-
- //{{INIT_MENUS
- //}}
- }
-
- public Emblaze(String title) {
- this();
- setTitle(title);
- }
-
- public synchronized void show() {
- move(50, 50);
- super.show();
- }
-
- public boolean handleEvent(Event event) {
- if (event.id == Event.WINDOW_DESTROY) {
- hide(); // hide the Frame
- return true;
- }
- if (event.target == close && event.id == Event.ACTION_EVENT) {
- close_Clicked(event);
- return true;
- }
- if (event.target == nextimage && event.id == Event.ACTION_EVENT) {
- nextimage_Clicked(event);
- return true;
- }
- if (event.target == previousimage && event.id == Event.ACTION_EVENT) {
- previousimage_Clicked(event);
- return true;
- }
- if (event.target == button1 && event.id == Event.ACTION_EVENT) {
- button1_Clicked(event);
- return true;
- }
- return super.handleEvent(event);
- }
-
- //{{DECLARE_CONTROLS
- geo.emblaze.Emblaze20 emblaze201;
- java.awt.Button nextimage;
- java.awt.Button previousimage;
- java.awt.Button close;
- java.awt.Button button1;
- symantec.itools.multimedia.SoundPlayer soundPlayer1;
- //}}
-
- //{{DECLARE_MENUS
- //}}
- }
-